package com.shisan.tingshu.user.client;

import com.shisan.tingshu.common.result.Result;
import com.shisan.tingshu.model.user.VipServiceConfig;
import com.shisan.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import com.shisan.tingshu.vo.user.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * 产品列表API接口
 *
 * @author qy
 */
@FeignClient(value = "service-user", fallback = UserInfoDegradeFeignClient.class, path = "/rpc/inner/userinfo")
public interface UserInfoFeignClient {

    @GetMapping("/getUserInfo/{userId}")
    Result<UserInfoVo> getUserInfo(@PathVariable(value = "userId") Long userId);

    @GetMapping("/getUserPaidAlbumTrack/{userId}/{albumId}")
    Result<Map<Long, String>> getUserPaidAlbumTrack(@PathVariable(value = "userId") Long userId,
                                                    @PathVariable(value = "albumId") Long albumId);

    @GetMapping("/getUserPaidAlbum/{userId}/{albumId}")
    Result<Boolean> getUserPaidAlbum(@PathVariable(value = "userId") Long userId,
                                     @PathVariable(value = "albumId") Long albumId);

    /**
     * 获取VIP服务配置信息
     * @param itemId
     * @return
     */
    @GetMapping("/getVipConfigById/{itemId}")
    Result<VipServiceConfig> getVipConfigById(@PathVariable(value = "itemId") Long itemId);

    @GetMapping("/getUserIdByOpenId/{openId}")
    Result<String> getUserIdByOpenId(@PathVariable(value = "openId") String openId);

    @GetMapping("/updateExpireVip")
    void updateExpireVip();
}